package com.sasis.webapp.action;

import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class ReloadOpenerAction extends BaseAction {

	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {

//		MessageResources messages = getResources(request);
//
//		String msg = messages.getMessage(getLocale(request),
//				"common.save.success");

		response.setContentType("text/html; charset=gb2312");

		PrintWriter out = response.getWriter();
		out.println("<html>");
		out.println("<head>");
		out.println("<title>Context Reloaded</title>");
		out.println("<script src='scripts/common.js'></script>");
		out.println("<style type='text/css'>");
		out.println("<!--");
		out.println("body {");
		out.println("margin-left: 0px;");
		out.println("margin-top: 0px;");
		out.println("margin-right: 0px;");
		out.println("margin-bottom: 0px;");
		out.println("font-size:12px;");
		out.println("color:#000000;");
		out.println("background-color: #F4F4F4;");
		out.println("}");
		out.println("a{");
		out.println("text-decoration:underline;");
		out.println("color:#000000;");
		out.println("}");
		out.println("a:hover{");
		out.println("text-decoration:underline;");
		out.println("color:#FF6600;");
		out.println("}");
		out.println("-->");
		out.println("</style>");
		out.println("</head>");
		out.println("<body>");
//		out.println(msg);
		out.println("<script type=\"text/javascript\">");
		out.println("refreshParent();");
		out.println("window.close();");
//		out.println("window.resizeTo(200,100);");
//		out.println("window.moveTo(300,300);");
		out.println("</script>");
		out.println("</body>");
		out.println("</html>");
		return null;
	}
}
